#ifndef GPIOPORT_H
#define GPIOPORT_H

#include <QMutex>
#include <QString>
#include <windows.h>
#include <REL_SUSI.H>

class GpioPort {
	/* data members */
	bool available;
	QMutex mutex;

	/* function members */
	GpioPort();

	bool init();
	void unInit();

public:
	/* function members */
	~GpioPort();
    static GpioPort * getInstance() {
		static GpioPort instance;
		return &instance;
	}

	int setDirection(int pin, bool dir);
	int setDirectionMulti(int pinMask, int dirMask);
	int setState(int pin, bool state);
	int setStateMulti(int pinMask, int stateMask);
	int getState(int pin, bool *state);
	int getStateMulti(int pinMask, int *stateMask);

	bool isAvailable();
};

#endif // GPIOPORT_H
